import React, { Prototypes } from 'react';
import { Link, browserHistory } from 'react-router';

class Logo extends React.Component{
  static Prototypes: {
    menus: PropTypes.array.isRequired
  }

  constructor(props) {
    super(props);
  }

  render() {
    let links = [];
    let defaultLinks = [
      <Link className="taga" to={{ pathname: '/', query: { userid: "userid" } }} key="0">基础数据</Link>,
      <Link className="taga" to="/test" key="1">测试模块</Link>
    ];
    this.props.menus.map(function(item){
      links.push(<Link className="taga" key={item.value} to={item.to}>{item.label}</Link>);
    });
    links = links.length === 0 ? defaultLinks : links;
    return (
      <div className="menus">
        {links}
      </div>
    );
  }
  
}; 

export default Logo;